home *** CD-ROM | disk | FTP | other *** search
- Path: dildog.lgc.com!usenet
- From: Glenn Carr <gcarr@tulsa.lgc.com>
- Newsgroups: comp.lang.c
- Subject: Incorporating build date into an executable?
- Date: Mon, 11 Mar 1996 16:52:28 -0600
- Organization: Landmark Graphics
- Message-ID: <3144AEAC.2F1C@tulsa.lgc.com>
- NNTP-Posting-Host: 134.132.131.47
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; AIX 1)
-
- What is the best way to incorporate the build date into an executable?
-
- Currently, I'm defining macros for the preprocessor when I compile...
-
- -DBUILD_INFO_DATE=\"`date "+%d-%h-%y"`\" -DBUILD_INFO_TIME=\"`date "+%H:%M"`\"
- -DBUILD_INFO_TZ=\"`date | cut -f6 -d\ `\" -DBUILD_INFO_VERS=\"`uname -v`\"
- -DBUILD_INFO_REL=\"`uname -r`\" -DBUILD_INFO_OS=\"`uname -s`\"
-
- I've setup the Imakefile for my main.c to include these flags when building, but
- our app uses several internal object libraries which also cause the app to be
- built. Is there a better way to stamp the executable with this information?
- I'd rather not pass in this mess, but would like to include it a header file
- that is updated right before the link. Any other better ways to do it?
-